home *** CD-ROM | disk | FTP | other *** search
/ MacHack 2000 / MacHack 2000.toast / pc / The Hacks / Softshoe / Lisa's Mac Parts / AppleEvents / Events / AEEvent.h < prev    next >
Text File  |  2000-06-23  |  2KB  |  72 lines

  1. // AEEvent.h
  2.  
  3. #ifndef AEEvent_h
  4. #define AEEvent_h
  5.  
  6. #ifndef AEDescriptor_h
  7. #include "AEDescriptor.h"
  8. #endif
  9. #ifndef AEParameter_h
  10. #include "AEParameter.h"
  11. #endif
  12. #ifndef AEAttribute_h
  13. #include "AEAttribute.h"
  14. #endif
  15. #ifndef AEVerb_h
  16. #include "AEVerb.h"
  17. #endif
  18. #ifndef AEList_h
  19. #include "AEList.h"
  20. #endif
  21.  
  22. class AEAddress;
  23. class AEStruct;
  24. class AEReplyHandler;
  25. class AETransaction;
  26.  
  27. class AEEvent: public AEDescriptor
  28.   {
  29.     private:
  30.         static pascal Boolean IgnoreEvents( EventRecord *, long *, RgnHandle * );
  31.  
  32.     public:
  33.         AEEvent()    {}
  34.         explicit AEEvent( const AEEvent& source )                    : AEDescriptor( source )    {}
  35.         AEEvent( AEVerb, const AEAddress& );
  36.         AEEvent( AESuite, AEEventID, const AEAddress& );
  37.         
  38.         // not yet implemented:
  39.             AEEvent( AEVerb, const AEAddress&, AEReplyHandler& );
  40.             AEEvent( AEVerb, const AEAddress&, AETransaction& );
  41.             AEEvent( AEVerb, const AEAddress&, AEReplyHandler&, AETransaction& );
  42.         
  43.         explicit AEEvent( const AEDescriptor& item )                : AEDescriptor( item, StaticType() )    {}
  44.         explicit AEEvent( const ConstAEListItem& item )            : AEDescriptor( item, StaticType() )    {}
  45.         explicit AEEvent( const ConstAEMember& item )            : AEDescriptor( item, StaticType() )    {}
  46.         explicit AEEvent( const ConstAEParameter& item )        : AEDescriptor( item, StaticType() )    {}
  47.         explicit AEEvent( const ConstAEAttribute& item )        : AEDescriptor( item, StaticType() )    {}
  48.         
  49.         static AEType StaticType()                                        { return AEType( typeAppleEvent ); }
  50.         bool TypeIsCorrect() const                                        { return Type() == StaticType(); }
  51.         
  52.         uint32 ParameterCount() const;
  53.         
  54.         const ConstAEParameter Parameter( AEKey i ) const                { return ConstAEParameter( *this, i ); }
  55.         AEParameter Parameter( AEKey i )                                        { return AEParameter( *this, i ); }
  56.         
  57.         const ConstAEListItem ParameterByNumber( uint32 i ) const    { return ConstAEListItem( AsList(), i ); }
  58.         AEListItem ParameterByNumber( uint32 i )                            { return AEListItem( AsList(), i ); }
  59.         
  60.         const ConstAEAttribute Attribute( AEKey i ) const                { return ConstAEAttribute( *this, i ); }
  61.         AEAttribute Attribute( AEKey i )                                        { return AEAttribute( *this, i ); }
  62.         
  63.         AEVerb Verb() const;
  64.         
  65.         bool MissedParameter() const;
  66.         void ThrowMissedParameter() const;
  67.         
  68.         static AEIdleUPP IgnoreIncomingEvents();
  69.   };
  70.  
  71. #endif
  72.